package org.arithmetic.acm.primary;

import java.util.Arrays;
import java.util.Scanner;

/**
 * Created by LUOLIANG on 2016/9/14.
 * 数组奇数项排序
 * 第一行输入一个t,代表有t组数据，对于每组数据，首先输入一个n代表有n个正整数，接下一行包含n个正整数a[1],a[2]...a[n], (1<=a[i]<=100000)
 * 输出一行n个数，用空格隔开。
 */
public class OddSort {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int[] arr1 = new int[50001];
        int[] arr2 = new int[100000];
        int temp = 0;
        int k = 0;
        int t = input.nextInt();
        while (t-- > 0) {
            int n = input.nextInt();
            temp = 0;
            k = 0;
            for (int i = 0; i < n; i++) {
                arr2[i] = input.nextInt();
                if (i % 2 == 0) {
                    arr1[k++] = arr2[i];
                }
            }
            Arrays.sort(arr1, 0, k);
            for (int i = 0; i < n; i++) {
                if (i % 2 == 0) {
                    System.out.print(i + 1 == n ? arr1[i / 2] : arr1[i / 2] + " ");
                } else
                    System.out.print(i + 1 == n ? arr2[i] : arr2[i] + " ");
            }
            System.out.println();
        }
    }
}
